import request from '../utils/request'
export function add(params) {
  return request({
    url: '/cart/add',
    method: 'post',
    params: params
  })
}

//立即购买
export function buyNow(params) {
  return request({
    url: '/cart/buyNow',
    method: 'post',
    params: params
  })
}

//获取购物车信息
export function getCart(params) {
  return request({
    url: '/cart/getCart',
    method: 'get',
    params: params
  })
}

//获取购物车信息
export function count(params) {
  return request({
    url: '/cart/count',
    method: 'get',
    params: params
  })
}

//获取购物车信息
export function del(ids) {
  return request({
    url: '/cart/del/' + ids,
    method: 'post',
  })
}

//获取购物车信息
export function update(data) {
  return request({
    url: '/cart/update',
    method: 'post',
    data: data
  })
}

export function buyForOrder(params){
  return request({
    url:'/cart/buyForOrder',
    method:'post',
    params:params
  })
}